<?php
session_start();
if(!@$_SESSION['username']) {
  echo "<script>window.location.href='login.php';</script>";
}
?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>搜索结果</title>
	<!--[if lt IE 9]>
	<script type="text/javascript" src="lib/html5.js"></script>
	<script type="text/javascript" src="lib/respond.min.js"></script>
	<script type="text/javascript" src="lib/PIE_IE678.js"></script>
	<![endif]-->
	<link href="../../css/H-ui.min.css" rel="stylesheet" type="text/css" />
	<link href="../../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
	<link href="../../lib/font-awesome/font-awesome.min.css" rel="stylesheet" type="text/css" />
	<!--[if IE 7]>
	<link href="lib/font-awesome/font-awesome-ie7.min.css" rel="stylesheet" type="text/css" />
	<![endif]-->
	<link href="../../lib/iconfont/iconfont.css" rel="stylesheet" type="text/css" />
	<!--[if IE 6]>
	<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
	<script>DD_belatedPNG.fix('*');</script>
	<![endif]-->
</head>
<body>
	<nav class="breadcrumb"><i class="iconfont">&#xf012b;</i> 首页 <span class="c-gray en">&gt;</span> 用户中心 <span class="c-gray en">&gt;</span> 用户管理 <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="icon-refresh"></i></a></nav>
	<div class="pd-20">
 	<form action="" method="post">
  	<div class="text-c">

    出发地:<input name="startStation" type="text" class="input-text" style="width:100px" placeholder="输入出发地" id="" name="">
    目的地:<input name="endStation" type="text" class="input-text" style="width:100px" placeholder="输入目的地" id="" name="">
   日期范围：
    <input name="startTime" type="text" onfocus="WdatePicker({Date:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}'})" id="datemin" class="input-text Wdate" style="width:120px;">
    -
    <input name="endTime" type="text" onfocus="WdatePicker({Date:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}'})" id="datemax" class="input-text Wdate" style="width:120px;">
    <input type="submit" name="submit" value="搜索" class="btn" />
  </div>
  </form>
  <div class="cl pd-5 bg-1 bk-gray mt-20">  <span class="r">共有数据：<strong>88</strong> 条</span> </div>
  <table class="table table-border table-bordered table-hover table-bg table-sort">
    <thead>
     <tr class="text-c">
        <!-- <th width="25"><input type="checkbox" name="" value=""></th> -->
        <th width="80">列车号</th>
        <th width="100">出发地</th>
        <th width="40">目的地</th>
        <th width="90">出发时间</th>
        <th width="150">到达时间</th>
        <th width="70">有座</th>
        <th width="70">无座</th>
        <th width="50">票价</th>
        <th width="100">操作</th>
      </tr>
    </thead>
    <tbody>
	<?php
		$map = array_filter($_POST);

		include_once('../../libraries/esaydb.class.php');
		if($_POST) {
			$map = array_filter($_POST);
			$db = new EasyDB();
			//$sql = "SELECT * FROM ob_user WHERE staion_start = ? OR staion_end = ? OR time_start <= ? OR time_end >= ?";

			$sql = "SELECT * FROM ob_station WHERE station_start = ? OR station_end = ? OR time_start >= ? AND time_end <= ?";
			$result = $db->queryAll($sql, array(@$map['startStation'],@$map['endStation'],@$map['startTime'],@$map['endTime']));
			foreach($result as $v) {
	?>

	<tr class="text-c">
        <!-- <td><input type="checkbox" value="1" name=""></td> -->
        <td><?php echo $v['sid']; ?></td>
        <td><?php echo $v['station_start']; ?></td>
        <td><?php echo $v['station_end']; ?></td>
        <td><?php echo $v['time_start']; ?></td>
        <td><?php echo $v['time_end']; ?></td>
        <td><?php echo $v['number']; ?></td>
        <td><?php echo $v['num_none']; ?></td>
        <td><?php echo "wait..." ?></td>
        <!-- <td class="user-status"><span class="label label-success radius">已启用</span></td> -->
        <!-- <td class="f-14 user-manage"><a style="text-decoration:none" onClick="user_stop(this,'10001')" href="javascript:;" title="停用"><i class="icon-hand-down"></i></a> <a title="编辑" href="javascript:;" onclick="user_edit('4','600','','编辑','user-add.html')" class="ml-5" style="text-decoration:none"><i class="icon-edit"></i></a> <a style="text-decoration:none" class="ml-5" onClick="user_password_edit('10001','600','240','修改密码','user-password-edit.html')" href="javascript:;" title="修改密码"><i class="icon-key"></i></a> <a title="删除" href="javascript:;" onclick="user_del(this,'1')" class="ml-5" style="text-decoration:none"><i class="icon-trash"></i></a></td> -->
        <td class="inco-plus"><a style="text-decoration:none" href="modules/station/addTicketAction.php" title="购票"><i class="icon-plus">加入购物车</i></a></td>
      </tr>

	<?php
			}
		}
	?>

      <!-- <tr class="text-c">
        <td><input type="checkbox" value="1" name=""></td>
        <td>1</td>
        <td><u style="cursor:pointer" class="text-primary" onclick="user_show('10001','360','','张三','user-show.html')">张三</u></td>
        <td>男</td>
        <td>13000000000</td>
        <td>admin@mail.com</td>
        <td>2</td>
        <td>1</td>
        <td>2</td>
        <td>3</td>
        <td>4</td>
        <td class="user-status"><span class="label label-success radius">已启用</span></td>
        <td class="f-14 user-manage"><a style="text-decoration:none" onClick="user_stop(this,'10001')" href="javascript:;" title="停用"><i class="icon-hand-down"></i></a> <a title="编辑" href="javascript:;" onclick="user_edit('4','600','','编辑','user-add.html')" class="ml-5" style="text-decoration:none"><i class="icon-edit"></i></a> <a style="text-decoration:none" class="ml-5" onClick="user_password_edit('10001','600','240','修改密码','user-password-edit.html')" href="javascript:;" title="修改密码"><i class="icon-key"></i></a> <a title="删除" href="javascript:;" onclick="user_del(this,'1')" class="ml-5" style="text-decoration:none"><i class="icon-trash"></i></a></td>
      </tr> -->
    </tbody>
  </table>

</div>
<script type="text/javascript" src="../../lib/jquery.min.js"></script>
<script type="text/javascript" src="../../lib/layer1.8/layer.min.js"></script>
<script type="text/javascript" src="../../lib/laypage/laypage.js"></script>
<script type="text/javascript" src="../../lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="../../lib/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="../../js/H-ui.js"></script>
<script type="text/javascript" src="../../js/H-ui.admin.js"></script>
<script type="text/javascript" src="../../js/H-ui.admin.doc.js"></script>
</body>
</html>